#include "widget.h"
#include "ui_widget.h"
#include<QLabel>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QString s="你好";
    connect(ui->pushButton,&QPushButton::clicked,this,[=](){
        setWindowTitle(s);
        //close();
    });
    //QLabel* label=new QLabel(this);
    //label->setText("你好");
     QPushButton*button = new QPushButton(this);
     button->setText("二次信号");
    // connect(button,&QPushButton::clicked,this,&Widget::hander);
}

Widget::~Widget()
{
    delete ui;
}

//void Widget::hander()
//{
//   setWindowTitle("我的窗口2");
//}


void Widget::on_pushButton_clicked()
{
    //disconnect(ui->pushButton,&QPushButton::clicked,this,&Widget::hander);
    setWindowTitle("我的窗口3");
}
